package com.shitao.forum.exception;


import com.shitao.forum.common.AppResult;
import javafx.application.Application;

/**
 * 自定义异常
 */
public class ApplicationException  extends RuntimeException{

    //在异常中保证有一个错误的信息
    protected AppResult errorResult;

    //自定义构造方法
    public ApplicationException (AppResult errorResult) {
        super(errorResult.getMessage());
        this.errorResult = errorResult;
    }

    //生成getter方法
    public AppResult getErrorResult() {
        return errorResult;
    }

    //重写父类中的几个方法
    public ApplicationException(String message) {
        super(message);
    }

    public ApplicationException(String message, Throwable cause) {
        super(message, cause);
    }

    public ApplicationException(Throwable cause) {
        super(cause);
    }
}
